# # # # # 类名:儿童,属性 无  方法 吃,喝,运动
# class Child(object):
#     def eat(self):
#         print('小朋友吃东西')
#     def drink(self):
#         print("小朋友喝水")
#     def sports(self):
#         print('小朋友天天运动')
# h1 = Child()
# h1.eat()
# h1.drink()
# h1.sports()


#
# #
# class Fruits(object):
#     def __init__(self,name,colour,price):
#         self.name = name
#         self.colour = colour
#         self.price = price
#     def add_fruits(self):
#         print(f'{self.name}颜色为:{self.colour},价格为:{self.price}')
#     def __str__(self):
#         return f'{self.name},{self.colour},{self.price}'
# h1 = Fruits('苹果','红色','5元')
# h2 = Fruits('橘子','黄色','4元')
# h3 = Fruits('西瓜','绿色','6元')
# h1.add_fruits()
# h2.add_fruits()
# h3.add_fruits()

# 类名:电脑  属性:品牌,价格,音乐名,电影名, 方法:播放
# class Computer(object):
#     def __init__(self,brand,price,music_name,movie_name):
#         self.brand = brand
#         self.price = price
#         self.music_name = music_name
#         self.movie_name = movie_name
#     def music(self):
#         print(f'播放音乐{self.music_name}')
#     def movie(self):
#         print(f'播放电影{self.movie_name}')
#     def __str__(self):
#         return f'{n1.brand}播放音乐{self.music_name},{n2.brand}播放电影{self.movie_name}'
# n1 = Computer('联想电脑',5000,'桥边姑娘','骇客帝国')
# n2 = Computer('苹果电脑',10000,'骇客帝国','桥边姑娘')
# n1.movie()
# n1.music()
# print(n1)
# 类名:电脑  属性:品牌,价格,音乐名,电影名, 方法:播放
class Computer():
    def __init__(self,brand,price):
        self.brand = brand
        self.price = price

    def music(self,music_name):
        print(f'{self.brand }播放{music_name}')
    def movie(self,movie_name):
        print(f'{self.brand}播放{movie_name}')
n1 = Computer('联想电脑',5000,)
n2 = Computer('苹果电脑',10000,)
n1.music('桥边姑娘')
n2.movie('骇客帝国')
n1.movie('荷塘月色')





